package com.xbongbong.paas.model.impl;

import com.xbongbong.paas.domain.dao.PaasFormRefDao;
import com.xbongbong.paas.domain.entity.PaasFormRefEntity;
import com.xbongbong.paas.model.PaasFormRefModel;
import com.xbongbong.paas.toolbox.exception.XbbException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author: 汪腾伟
 * @date: Created in 2021/8/18 18:47
 * @description：
 */
@Service("paasFormRefModel")
public class PaasFormRefModelImpl implements PaasFormRefModel {

    @Resource
    private PaasFormRefDao paasFormRefDao;

    @Override
    public Integer insert(PaasFormRefEntity entity) throws XbbException {
        return null;
    }

    @Override
    public Integer update(PaasFormRefEntity entity) throws XbbException {
        return null;
    }

    @Override
    public List findEntitys(Map<String, Object> param) {
        return paasFormRefDao.findEntitys(param);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return null;
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }

    @Override
    public PaasFormRefEntity getMainFormIdByFormId(Long formId, String corpid) {
        return paasFormRefDao.getMainFormIdByFormId(formId, corpid);
    }


    /**
     * 批量插入实体
     * @param list
     * @return 返回数据的列表
     */
    @Override
    public List<PaasFormRefEntity> insertBatch(List<PaasFormRefEntity> list) {
        paasFormRefDao.insertBatch(list);
        return list;
    }

    /**
     * 根据公司id和主业务的formId获取关联表信息
     *
     * @param mainFormId 主业务的formId
     * @param corpid 公司id
     * @return
     */
    @Override
    public List<PaasFormRefEntity> getListByMainFormId(Long mainFormId, String corpid) {
        return paasFormRefDao.getListByMainFormId(mainFormId, corpid);
    }

    /**
     * 批量删除
     *
     * @param list 主键id集合
     * @param corpid
     * @return
     */
    @Override
    public Integer deleteBatch(List<Long> list, String corpid) {
        return paasFormRefDao.deleteBatch(list, corpid);
    }
}
